package com.example.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {

    private static DBHelper instant = null;

    public static DBHelper getInstance(Context context){
        if (instant == null){
            instant = new DBHelper(context);
        }
        return instant;
    }
    public DBHelper(Context context) {
        super(context,"test.db",null,1);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE if not exists student(" +
                "_id INTEGER PRIMARY KEY AUTOINCREMENT," +
                "username text," +
                "password text)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
